import DOMPurify from "dompurify";

export const sanitizeHTML = (html: string) =>
  DOMPurify.sanitize(html ?? "", {
    USE_PROFILES: { html: true },
    ALLOWED_ATTR: ["href", "title", "alt", "src", "style"],
    ALLOWED_URI_REGEXP: /^(?:(?:https?|mailto|tel|data:image\/(?:png|jpeg|gif));)/i
  });
